<script setup>
import { useRoute, useRouter } from 'vue-router'
import { ref, onMounted } from 'vue'
import { useScoreStore } from '@/stores/score.js'
import NavBar from '@/components/NavBar.vue'
const scoreStore = useScoreStore()
const route = useRoute()
const data = ref()
const testData = { name: 'sss', number: 'ss' }
const finish = ref(false)
onMounted(() => {
  data.value = scoreStore.dataList[route.params.index]
  console.log(data.value)
  finish.value = true
})
</script>
<template>
  <NavBar name="积分详情"></NavBar>
  <div v-if="finish" class="container">
    <h1>{{ data.bil_month }}</h1>
    <div class="first-container">
      <div class="row">
        <div class="header">资产业务号码</div>
        <div>{{ data.acc_nbr }}</div>
      </div>
      <div class="row">
        <div class="header">积分类型</div>
        <div>{{ data.jf_type }}</div>
      </div>
      <div class="row">
        <div class="header">销售品</div>
        <div>{{ data.prom_name }}</div>
      </div>
      <div class="row">
        <div class="header">积分</div>
        <div>{{ data.SCORE }}</div>
      </div>
      <div class="row">
        <div class="header">本地激励</div>
        <div>{{ data.bdjl }}</div>
      </div>
      <div class="row">
        <div class="header">营销工号</div>
        <div>{{ data.sales_emp_code }}</div>
      </div>
      <div class="row">
        <div class="header">营销人员</div>
        <div>{{ data.sales_employee_name }}</div>
      </div>
    </div>
    <div class="first-container">
      <div class="row_2">
        <div class="header">扣回规则</div>
        <div>{{ data.fine_rule_name }}</div>
      </div>
      <div class="row_2">
        <div class="header">调整原因</div>
        <div>{{ data.adjust_reason }}</div>
      </div>
      <div class="row_2">
        <div class="header">积分方案</div>
        <div>{{ data.score_offer_name }}</div>
      </div>
      <div class="row_2">
        <div class="header">积分策略</div>
        <div>{{ data.score_strategy_name }}</div>
      </div>
    </div>
    <div class="first-container">
      <div class="row_2">
        <div class="header">新积分类型</div>
        <div>{{ data.NEW_SCORE_TYPE_NAME }}</div>
      </div>
      <div class="row_2">
        <div class="header">县分</div>
        <div>{{ data.fj_area_name }}</div>
      </div>
      <div class="row_2">
        <div class="header">支局</div>
        <div>{{ data.zj_area_name }}</div>
      </div>
    </div>
    <div></div>
    <div></div>
  </div>
</template>
<style scoped>
.container {
  padding: 1rem;
  background-color: #f7f8f9;
  overflow-y: auto;
}
.first-container {
  border-radius: 10px; /* 圆角半径 */
  margin-top: 1rem;
  background-color: #ffffff;
}
.row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  padding: 1rem;
}
.row_2 {
  padding: 1rem;
}
.header {
  font-weight: bold;
  /* font-family: PingFang SC-Medium; */
}
/* h1 {
  background-image: linear-gradient(red, yellow);
} */
</style>
